package com.smart.config.utils;

/**
 * @Author xiaoqiang
 * @Version ExceptionUtils.java, v 0.1 2025年03月22日 21:52 xiaoqiang
 * @Description: TODO
 */
public class ExceptionUtils {

    public static String createStackTrackMessage(Throwable e) {
        StringBuilder messsage = new StringBuilder();
        if (e != null) {
            messsage.append(e.getClass()).append(": ").append(e.getMessage()).append("\n");
            StackTraceElement[] elements = e.getStackTrace();
            for (StackTraceElement stackTraceElement : elements) {
                messsage.append("\t").append(stackTraceElement.toString()).append("\n");
            }
        }
        return messsage.toString();
    }

}
